package com.team.coupon.api;

import com.team.common.core.domain.R;
import com.team.common.core.web.domain.AjaxResult;
import com.team.coupon.api.domain.BizCoupon;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.team.coupon.api.factory.RemoteCouponFallbackFactory;
import java.util.List;

/**
 * 优惠券服务远程调用接口
 */
@FeignClient(contextId = "remoteCouponService", value = "team-coupon-service", fallbackFactory = RemoteCouponFallbackFactory.class)
public interface RemoteCouponService {

    /**
     * 获取今天秒杀的优惠券列表
     */
    @GetMapping("/coupon/coupons")
    AjaxResult listCoupons();

    /**
     * 添加优惠券
     */
    @PostMapping("/coupon/addCoupon")
    AjaxResult addCoupons(@RequestBody BizCoupon bizCoupon);

    /**
     * 更新优惠券
     */
    @PutMapping("/coupon/updateCoupon")
    AjaxResult updateCoupon(@RequestBody BizCoupon bizCoupon);

    /**
     * 删除优惠券
     */
    @PutMapping("/coupon/deleteCoupon/{bizCouponId}")
    AjaxResult deleteCoupon(@PathVariable Long bizCouponId);

    /**
     * 查看店铺的优惠券信息
     */
    @GetMapping("/coupon/getCouponByEntityId/{entityId}")
    AjaxResult getCouponByEntityId(@PathVariable Long entityId);

    /**
     * 根据id查询优惠券信息
     */
    @GetMapping("/coupon/getCoupon/{id}")
    AjaxResult getCouponById(@PathVariable Long id);
} 